New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double-click to select attribute text #1484
Conversation
Each show page displays a description list of the fields. When the field is text, it is rendered inside an inline `<span>`. I've found it common to want to double-click this text to copy-paste an identifier from our admin app into other systems. Previously, double-clicking would not select the field's value. The bug can be seen on the show page in the demo app. For example, try selecting the city or zip code values from: https://administrate-prototype.herokuapp.com/admin/orders/198962 Changing the markup to be a block `<div>` fixes the bug. Alternatively, we could change the `preserve-whitespace` CSS rule to be `display: block;`.
@croaky - What browser are you using? I'm unable to reproduce. I have tried Firefox, Chrome and Safari on macOS, and Firefox on Linux. With and without the change, I can select the whole field with a triple click. Incidentally, I think a better example is a Product description. The Order fields you mention are |
Chrome. Just tried triple-clicking, that works. Double-clicking doesn't. https://administrate-prototype.herokuapp.com/admin/products/blokus Try to select the name value "Blokus" with a double-click. The result looks like this: |
OK, I was able to reproduce what your screenshot shows on macOS Chrome. However How about changing this to add a |
@pablobm Good call on I tried using a For further background: we put Administrate in front of an existing production (follower, read-only) Postgres database, whose primary API server is written in Go. We generated some lightweight ActiveRecord models from the schema to make it all work correctly. Our particular choices for database schema or how we generated it might have resulted in some inconsistency in For example, some of our Our case might be a little edge so understand if you don't want to support or go with another solution. Easy enough to port this approach into our own app using the generators (already done). This has been the most reliable approach I've found so far, though, so wanted to report back upstream! |
Another potential approach in <%= render 'fields/text/show', field: field %> |
On second inspection, I must have done something wrong on the first inspection, because now I can reproduce the behaviour exactly as you describe. I think the change makes sense, and that the old behaviour was a bit weird. Merging! Thank you 👍 |
Each show page displays a description list of the fields.
When the field is text, it is rendered inside an inline
<span>
.I've found it common to want to double-click this text
to copy-paste an identifier from our admin app into other systems.
Previously, double-clicking would not select the field's value.
The bug can be seen on the show page in the demo app. For example,
try selecting the city or zip code values from:
https://administrate-prototype.herokuapp.com/admin/orders/198962
Changing the markup to be a block
<div>
fixes the bug.Alternatively, we could change the
preserve-whitespace
CSS ruleto be
display: block;
.